-
Notifications
You must be signed in to change notification settings - Fork 53
Expand Azure Functions smoke tests to cover source generator scenarios #604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: YunchuWang <[email protected]>
Co-authored-by: YunchuWang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the Azure Functions smoke tests to provide comprehensive end-to-end validation of the Durable Task source generator functionality. Previously, the smoke tests only validated basic orchestration scenarios without exercising the source generator's outputs for activities, entities, events, and sub-orchestrations.
Key changes:
- Added comprehensive source generator scenario testing with class-based orchestrators, activities, entities, and durable events
- Extended PowerShell test runner to validate all generated extension methods and their interactions
- Configured project namespace properties to ensure generated types resolve correctly
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| test/AzureFunctionsSmokeTests/SourceGeneratorScenarios.cs | New file containing GeneratedOrchestration that exercises all source generator outputs: class-based activities (ComposeGreeting, CountCharactersActivity), entity operations (GeneratorCounter), durable events (GeneratorSignal), and child orchestrations |
| test/AzureFunctionsSmokeTests/run-smoketests.ps1 | Extended with Steps 9-10 to trigger and validate the source generator orchestration, including assertions for greeting text, entity counter values, child orchestration responses, and event message handling |
| test/AzureFunctionsSmokeTests/AzureFunctionsSmokeTests.csproj | Added TopLevelNamespace, RootNamespace, and AssemblyName properties to align namespace resolution for source-generated extension methods |
| test/AzureFunctionsSmokeTests/README.md | Updated structure section and test flow description to document the new source generator scenario coverage |
| throw "Unexpected greeting from generated activity: $greeting" | ||
| } | ||
|
|
||
| if (-not $greetingLength) { |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation logic checks if greetingLength is falsy before throwing an error. However, zero (0) is a valid length value but evaluates to false in PowerShell. If the greeting were an empty string, the length would be 0, which would incorrectly trigger the error "Greeting length was not populated correctly: 0". Consider checking for null or using -eq $null instead of -not to avoid false positives with zero values.
| if (-not $greetingLength) { | |
| if ($null -eq $greetingLength) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the validation to use null checks so zero-length values are treated correctly. Fix is in commit 8afdd80.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@copilot update pr description to follow .github/PULL_REQUEST_TEMPLATE.md |
Co-authored-by: YunchuWang <[email protected]>
|
test/AzureFunctionsSmokeTests/SourceGeneratorScenarios.cs EntityInstanceId counterId = new EntityInstanceId(nameof(GeneratorCounter), context.InstanceId); @copilot why here use signalentity not callentity? |
|
Co-authored-by: YunchuWang <[email protected]>
Switched to CallEntityAsync so the add operation completes before reading the counter; change is in commit 410895f. |
Switched to CallEntityAsync so the add operation completes before reading the counter; change is in commit 410895f. |
The smoke test CI lacked end-to-end coverage of Durable Functions source generator outputs, leaving activity/entity/event/sub-orchestration paths unvalidated.
SourceGeneratorScenarios.cswith a generated orchestration, activity, entity, durable event, and child orchestration to exercise all generator outputs.AzureFunctionsSmokeTestsso generated types resolve correctly.run-smoketests.ps1to trigger and validate the new generated orchestration outputs alongside the existing HelloCities flow, including null-safe validation and awaited entity updates for deterministic results.Summary
What changed?
Why is this change needed?
Issues / work items
Project checklist
release_notes.mdAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
AI verification (required if AI was used):
Testing
Automated tests
dotnet build test/AzureFunctionsSmokeTests/AzureFunctionsSmokeTests.csprojManual validation (only if runtime/behavior changed)
Notes for reviewers
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.